<template>
  <div>
    <p>我是home组件</p>
    <p>{{ tit }}</p>
    <p><button @click="emitFn">子传父</button></p>
  </div>
</template>

<script>
export default {
  name: "",
  props: ["tit"],
  data() {
    return {};
  },
  setup(props, context) {
    // console.log(props.tit);
    const nameList = ["阿里", "字节跳动"];

    const emitFn = () => {
      //   console.log(context);
      context.emit("transfer", nameList);
    };

    return {
      emitFn,
    };
  },
};
</script>
<style scoped>
</style>